import request from '@/utils/request'

// 查询生成试题列表
export function listGenerate_exam(query) {
  return request({
    url: '/generateTest/generate_exam/list',
    method: 'get',
    params: query
  })
}

// 查询生成试题详细
export function getGenerate_exam(examId) {
  return request({
    url: '/generateTest/generate_exam/' + examId,
    method: 'get'
  })
}

// 新增生成试题
export function addGenerate_exam(data) {
  return request({
    url: '/generateTest/generate_exam',
    method: 'post',
    data: data
  })
}

// 修改生成试题
export function updateGenerate_exam(data) {
  return request({
    url: '/generateTest/generate_exam',
    method: 'put',
    data: data
  })
}

// 删除生成试题
export function delGenerate_exam(examId) {
  return request({
    url: '/generateTest/generate_exam/' + examId,
    method: 'delete'
  })
}

// 下载请求
export function generateDownload(examId) {
  return request({
    url: '/generateTest/generate_exam/download/' + examId,
    method: 'get',
    responseType: 'blob', // 设置响应类型为blob
    timeout:180000 // 设置超时时间为1小时
  })
}
